package com.hoshiicloud.gateway.feign;

import com.hoshiicloud.auth.vo.LoginVO;
import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.gateway.feign.fallback.HystrixAuthFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * @program: hoshiibuy
 * @description: 登录验证服务
 * @author: Mr.wu
 * @create: 2019-06-24 14:20
 **/
@FeignClient(name = "hoshiicloud-auth", fallbackFactory = HystrixAuthFeignFallback.class)
public interface AuthService {

    @PostMapping(value = "/login2")
    Response login(@RequestParam("userName") String userName,
            @RequestParam("password") String password, @RequestParam("userType") String userType,
            @RequestParam("platformId") String platformId);

    @PostMapping(value = "/logout")
    Response logout();

    @PostMapping(value = "/storeLogin")
    Response<LoginVO> storeLogin(@RequestParam("storeId") Long storeId, @RequestParam("token") String token);

    @PostMapping(value = "/platformLogin")
    Response<LoginVO> platformLogin(@RequestParam("platformId") Long platformId, @RequestParam("token") String token);

    @PostMapping(value = "/memberAccessToken")
    Response<LoginVO> memberAccessToken(@RequestParam("token") String token);

     @PostMapping("/companyUserAccessToken")
     Response<LoginVO> companyUserLogin(@RequestParam("token") String token);

}
